﻿using Dora.Orm.Core.Domain.Entities;
using Dora.Tools.Enums;
using Dora.Tools.Enums.AdminUser;
using Dora.Tools.Utility;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dora.Services.AdminUser.Dto.ViewDto
{
    public class RoleViewDto
    {
        #region model

        /// <summary>
        /// 
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 系统Id
        /// </summary>
        public int SystemId { get; set; }

        /// <summary>
        /// 系统Key
        /// </summary>
        public string SystemKey { get; set; }

        /// <summary>
        /// 组织机构Id
        /// </summary>
        public int OrgId { get; set; }

        /// <summary>
        /// 组织机构名称
        /// </summary>
        public string OrgName{ get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 角色编号;唯一，可修改，可用于标识特殊的角色，如EB超级管理员
        /// </summary>
        public string RoleNO { get; set; }

        /// <summary>
        /// 排序;倒序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 组织机构类型
        /// </summary>
        public int OrgType { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 是否启用;停用后，拥有角色的用户不能再有这个角色对应的权限
        /// </summary>
        public short IsEnabled { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreatedUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }
        #endregion
        #region extend
        /// <summary>
        /// 权限类型
        /// </summary>
        public string IsEnabledText
        {
            get
            {
                return ((CommonWhetherEnum)IsEnabled).ToDescription();
            }
        }
        /// <summary>
        /// 组织机构类型 文本
        /// </summary>
        public string OrgTypeText
        {
            get
            {
                return ((PermissionOrgType)OrgType).ToDescription();
            }
        }
        #endregion
    }
}
